#ifndef _ALGORITHM
#define _ALGORITHM

#include <string>
#include <iostream>
#include "Buffer.h"

namespace mylib {
	class Err_get_str {};
	class Err_get_ec {};
	class Err_skip {};
	void get_escape_char(mylib::Buffer &in, char &c);
	void get_str(mylib::Buffer &in, std::string &str);		// from " to "
	void get_id(mylib::Buffer &from, std::string &s);		// get a id
	void skip_line_com(mylib::Buffer &from);				// skip // comment
	void skip_dou_lines_com(mylib::Buffer &from);			// to match "*/"
	void skip_ws(mylib::Buffer &from);						// skip whitespace
}
namespace mylib {
	inline void utos(std::string &val, size_t n){			//convert a size_t integer to a string
		std::size_t t=n/10;
		if( t ) {
			utos(val, t);
			val += n%10+'0';
		}else {
			val += n%10+'0';
		}
	}
}
#endif
